package com.sum.common.bean;

import java.util.Objects;

/**
 * 锁定参数
 */
public class LockParams {
    private final String accessPassword;
    private final int regionPosition;
    private final int lockTypePosition;

    public LockParams(String accessPassword, int regionPosition, int lockTypePosition) {
        this.accessPassword = accessPassword;
        this.regionPosition = regionPosition;
        this.lockTypePosition = lockTypePosition;
    }

    public String getAccessPassword() { return accessPassword; }
    public int getRegionPosition() { return regionPosition; }
    public int getLockTypePosition() { return lockTypePosition; }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LockParams that = (LockParams) o;
        return regionPosition == that.regionPosition &&
                lockTypePosition == that.lockTypePosition &&
                Objects.equals(accessPassword, that.accessPassword);
    }

    @Override
    public int hashCode() {
        return Objects.hash(accessPassword, regionPosition, lockTypePosition);
    }

    @Override
    public String toString() {
        return "LockParams{" +
                "accessPassword='" + accessPassword + '\'' +
                ", regionPosition=" + regionPosition +
                ", lockTypePosition=" + lockTypePosition +
                '}';
    }
}
